﻿
stringfilter:host,lang,ref
;enable string filter in configuration for frontdoor first
debug$valueinterval:rnd
;enable value interval in configuration for frontdoor in debug folder first
frontdoor$valueinterval:rnd
;also enable value interval in configuration for frontdoor in frontdoor folder, it uses to redirect 10% traffics to frontdoor.test

[frontdoor]

;hddos configurations
debugmode$bypassInternalRequest=false
bypassInternalRequest=true
;use ip as example, fakeInsertIntervalMS~1s, overall percent = 0.3, query length = 1024
;so if the frequence of requests is <=2s, after at most 1024/3*2s, the query will contains >1/3 request & <2/3 fake request,
;and the request will be blocked.
;debugmode$urlEnable=false
urlEnable=true
urlQueueLength=1024
;in the last 1024 requests <include fake insert requests, to avoid block forever, if no other users>,
;over 80% requests to a same url, then block this kind of requests
urlRejectOverallPercent=0.8
;if over 50% of current capacibility is for one url, then reject it
urlRejectCurrentPercent=0.5
;automatically fake some request, to avoid block forever if no other users
urlFakeInsertIntervalMS=512
;debugmode$resourceEnable=false
resourceEnable=true
resourceQueueLength=1024
resourceRejectOverallPercent=0.8
resourceRejectCurrentPercent=0.5
resourceFakeInsertIntervalMS=512
;debugmode$ipEnable=false
ipEnable=true
;debugmode$ipQueueLength=128
;debugmode$ipRejectOverallPercent=0.2
;debugmode$ipRejectCurrentPercent=0.2
;debugmode$ipFakeInsertIntervalMS=1024000000
ipQueueLength=1024
ipRejectOverallPercent=0.3
;should not use more then 20 threads from a single ip at same time
ipRejectCurrentPercent=0.2
ipFakeInsertIntervalMS=1024
;debugmode$refererEnable=false
refererEnable=true
refererQueueLength=1024
refererRejectOverallPercent=0.8
refererRejectCurrentPercent=0.5
refererFakeInsertIntervalMS=512
;the capacibility of current http server, such as the thread count of httpServer2
debugmode$resourceCount=32
frontdoor.test$resourceCount=128
resourceCount=256

;frontdoor configurations
frontdoor.test$port=800
;debug$port=80,81,88,800,900
debugmode$port=900
port=80,81,88
frontdoor.test$threadCount=128
debugmode$threadCount=32
threadCount=256
staticCacheSize=1024
staticCacheLife=18000000
maintain=maintain.txt
error=errorpage.html
reject=reject.txt
retrytimes=128
holdtime=1800000; 30 minutes
sleeptime=4
delayjumpDelay=5

;supported filters for following rules
;httpcontext filters
;   host - host name in request
;   port - port in request
;   ua - user agent in request
;   ref - referer of request
;   ip - user ip
;   lang - language of user browser
;frontdoor filters
;   urlhash - hash value of url [0, maxUInt32], according to implement of string.GetHashCode()
;   pqhash - hash value of path and query [0, maxUInt32], according to implement of string.GetHashCode()
;   rnd - a random value, for randomly distributing [0, 99]
;as enabled stringfilter, so * and ? is workable here
;also valueinterval, 0-100 <means [0,100)> or [0,100] is workable here, but value of number only

[redirections]
;redirection rules definition, prefix=destination|delayjump

;some debug rules
debugmode$/&host:hzj-jie.gicp.net=http://www.hzj-jie.net/|true
;debugmode$/&host:localhost=http://127.0.0.1/|true

;send x% traffic to frontdoor.test
frontdoor$/&host:www.*&rnd:0-10=http://www.hzj-jie.net:800/|false
frontdoor$/&host:hzj-jie.net&port:88&rnd:0-10=http://share.hzj-jie.net:800/|false
frontdoor$/&host:hzj-jie.net&rnd:0-10=http://hzj-jie.net:800/|false
frontdoor$/&host:share.*&rnd:0-10=http://share.hzj-jie.net:800/|false
frontdoor$/&host:iis.*&rnd:0-10=http://iis.hzj-jie.net:800/|false
frontdoor$/&host:share2.*&rnd:0-10=http://share2.hzj-jie.net:800/|false
frontdoor$/&host:myapp.*&rnd:0-10=http://myapp.hzj-jie.net:800/|false
frontdoor$/&host:urlhandlers.*&rnd:0-10=http://urlhandlers.hzj-jie.net:800/|false
frontdoor$/&host:searchpk.*&rnd:0-10=http://searchpk.hzj-jie.net:800/|false
frontdoor$/&host:search.*&rnd:0-10=http://search.hzj-jie.net:800/|false
frontdoor$/&host:roomview.*&rnd:0-10=http://roomview.hzj-jie.net:800/|false
;frontdoor$/&host:rlss.in&rnd:0-10=http://rlss.in:800/|false

;some retired urls
/&host:hzj-jie.gicp.net=http://www.hzj-jie.net/|true
/&host:hzj-jie.vicp.net=http://share.hzj-jie.net/|true
/&host:hzj-jie.eicp.net=http://searchpk.hzj-jie.net/|true
;/&host:s.*&port:800=http://rlss.in:800/|true
/&host:s.*=http://rlss.in/|true
/&host:u.*=http://rlss.in/|true
/&host:z.*=http://rlss.in/|true
;/&host:*.rlss.in&port:800=http://rlss.in:800/|true
;/&host:*.rlss.in=http://rlss.in/|true
/my_applications/&host:share2.*=http://myapp.hzj-jie.net/|true
/my_applications/&host:myapp.*=http://myapp.hzj-jie.net/|true

[rules]
;rule definition, prefix=destination|needFDHeaders

;some debug rules
debugmode$/download/&host:elpmis=http://hzj-jie-8320-2/my_applications/|false
debugmode$/~&host:elpmis&ref:*elpmis/download/*=http://hzj-jie-8320-2/~|false
debugmode$/?&host:elpmis&ref:*elpmis/download/*=http://hzj-jie-8320-2/?|false
debugmode$/&host:elpmis=http://elpmis:81/
debugmode$/&host:searchpk=http://hzj-jie-8320-2:87/
debugmode$/&host:rss=http://hzj-jie-8320-2:85/
debugmode$/&host:myapp=http://hzj-jie-8320-2/my_applications/
debugmode$/&host:s&port:81=http://hzj-jie-8320-2:901/
debugmode$/&host:s&port:800=http://hzj-jie-8320-2:901/
debugmode$/&host:s=http://hzj-jie-8320-2:90/
;debugmode$/&host:s=http://localhost:90/
debugmode$/&host:counter=http://hzj-jie-8320-2:91/counter/|false
debugmode$/&host:securityfiletp=http://hzj-jie-t43:900/
;debugmode$/&host:share&rnd:0-50=http://hzj-jie-8320-2:88/
debugmode$/&host:share=http://hzj-jie-8320-2/
debugmode$/&host:route=http://192.168.1.1:8282/
debugmode$/&host:blog=http://hzj-jie-8320-1:94/
debugmode$/&host:filehost=http://hzj-jie-8320-2:104/
debugmode$/&host:id=http://hzj-jie-8320-2:101/
debugmode$/&host:iis=http://hzj-jie-8320-2:88/|false
debugmode$/=http://hzj-jie-8320-1:82/

;root rules, from /
;domain rules
;temporary use hfs to serve download requests from elpmis.*
/download/&host:*elpmis.*=http://hzj-jie-8320-2/my_applications/|false
/~&host:*elpmis.*&ref:*elpmis.*/download/*=http://hzj-jie-8320-2/~|false
/?&host:*elpmis.*&ref:*elpmis.*/download/*=http://hzj-jie-8320-2/?|false
/&host:*elpmis.*=http://hzj-jie-8320-2:99/
;/&host:rlss.in&port:800=http://hzj-jie-8320-2:901/
/&host:*rlss.in=http://hzj-jie-8320-2:90/
/&host:*zmd.be=http://hzj-jie-8320-2:90/
/&host:*happybirthdaybillg*=http://hzj-jie-8320-2:98/
/&host:*shuo.be=http://hzj-jie-8320-1:94/

;port rules
/&port:88=http://hzj-jie-8320-2:88/

;subdomain rules
/&host:hzj-jie.eicp.net=http://hzj-jie-8320-2:87/
/&host:hzj-jie.xicp.net=http://hzj-jie-8320-2:85/
/&host:searchpk.*=http://hzj-jie-8320-2:87/
/&host:search.*=http://hzj-jie-8320-2:87/
/&host:rss.*=http://hzj-jie-8320-2:85/
/&host:newline.*=http://hzj-jie-t60p/
/&host:randomfiletp.*=http://hzj-jie-8320-2:83/
/&host:urlhandlers.*=http://hzj-jie-8320-2:86/
/&host:securityfiletp.*=http://hzj-jie-8320-1:83/
/&host:counter.*=http://hzj-jie-8320-2:91/
;/&host:count.*=http://hzj-jie-8320-2:902/
/&host:count.*=http://hzj-jie-8320-2:91/
/&host:share.*=http://hzj-jie-8320-2:88/|false
/&host:iis.*=http://hzj-jie-8320-2:88/|false
;special hack for hfs, it uses absolute static file path, such as ~*.css
/&host:hzj-jie.vicp.net=http://hzj-jie-8320-2/|false
/&host:share2.*=http://hzj-jie-8320-2/|false
/&host:myapp.*=http://hzj-jie-8320-2/my_applications/|false
/~&host:myapp.*=http://hzj-jie-8320-2/~|false
/?&host:myapp.*=http://hzj-jie-8320-2/?|false
/favicon.ico&host:myapp.*=http://hzj-jie-8320-2/favicon.ico|false
;/&host:s.*&port:800=http://hzj-jie-8320-2:901/
/&host:s.*=http://hzj-jie-8320-2:90/
;/&host:u.*=http://hzj-jie-8320-2:901/
;/&host:z.*=http://hzj-jie-8320-2:89/
/&host:u.*=http://hzj-jie-8320-2:90/
/&host:z.*=http://hzj-jie-8320-2:90/
/&host:time.*=http://hzj-jie-8320-2:86/time/|false
/&host:timenow.*=http://hzj-jie-8320-2:86/timenow/|false
/&host:counterDraw.*=http://localhost:95/
/&host:counterDraw1.*=http://hzj-jie-8320-1:95/
/&host:counterDraw2.*=http://hzj-jie-8320-2:95/
/&host:counterDraw3.*=http://hzj-server-1:95/
/&host:wfileis.*=http://hzj-jie-8320-1:94/
/&host:say.*=http://hzj-jie-8320-1:94/
/&host:blog.*=http://hzj-jie-8320-1:94/
/&host:*wm8090.*=http://hzj-jie-8320-1:96/
/&host:roomview.*=http://hzj-jie-8320-1:97/
/&host:push.*=http://hzj-jie-8320-1:98/
/&host:publisher.*=http://hzj-jie-8320-2:99/
/&host:winbsod.*=http://hzj-jie-8320-1:100/
/&host:random.*=http://hzj-jie-8320-1:101/
/&host:emule.*=http://hzj-jie-8320-2:4711/
/DasBlog/&host:hzblog.*=http://hzj-jie-8320-2:88/DasBlog/|false
/&host:hzblog.*=http://hzj-jie-8320-2:88/DasBlog/|false
/&host:filehost.*=http://hzj-jie-8320-2:104/
/&host:route.*=http://192.168.1.1:8282/
/&host:id.*=http://hzj-jie-8320-2:101/
/&host:oc.*=http://hzj-jie-8320-2:100/
/&host:ava.*=http://hzj-jie-8320-2:105/
/discuz/&host:forum.*=http://hzj-jie-8320-2:88/discuz/|false
/&host:forum.*=http://hzj-jie-8320-2:88/discuz/|false

;machine rules
/&host:hzj-jie-t43.*=http://hzj-jie-t43/
/&host:hzj-jie-8320-1.*=http://hzj-jie-8320-1/
/&host:hzj-jie-8320-2.*=http://hzj-jie-8320-2/
/&host:hzj-jie-sandbox.*=http://hzj-jie-sandbox/
/&host:hzj-jie-x31.*=http://hzj-jie-x31/
/&host:hzj-peking-desk.*=http://hzj-peking-desk/
/&host:hzj-lowend-1.*=http://hzj-lowend-1/

/hzj-jie-t43&host:*hzj-jie.net=http://hzj-jie-t43|false
/hzj-jie-x31&host:*hzj-jie.net=http://hzj-jie-x31|false
/hzj-jie-8320-1&host:*hzj-jie.net=http://hzj-jie-8320-1|false
/hzj-jie-8320-2&host:*hzj-jie.net=http://hzj-jie-8320-2|false
/hzj-peking-desk&host:*hzj-jie.net=http://hzj-peking-desk|false
/hzj-peking-serv&host:*hzj-jie.net=http://hzj-peking-serv|false
/hzj-lowend-1&host:*hzj-jie.net=http://hzj-lowend-1|false
/sandbox&host:*hzj-jie.net=http://hzj-jie-sandbox|false

;application rules
/firstpage&host:*hzj-jie.net=http://hzj-jie-8320-2:81|false
/rss/&host:*hzj-jie.net=http://hzj-jie-8320-2:85/|false
/rlogserve&host:*hzj-jie.net=http://hzj-jie-8320-2:84/|false
/redir&host:*hzj-jie.net=http://hzj-jie-8320-2:86/redir
/reloader&host:*hzj-jie.net=http://hzj-jie-8320-2:86/reloader
/snapshot&host:*hzj-jie.net=http://hzj-jie-8320-2:86/snapshot
/time&host:*hzj-jie.net=http://hzj-jie-8320-2:86/time
/timenow&host:*hzj-jie.net=http://hzj-jie-8320-2:86/timenow

/=http://hzj-jie-8320-1:82/
DEFAULT=http://hzj-jie-8320-1:82/

[staticfiles]
;staticfile definition, pathquery=destination|contentType
/__readme.txt__&lang:en-us*=readme.en.txt|text/plain\; charset=utf-8
/__readme.txt__=readme.zh.txt|text/plain\; charset=utf-8
/readme.txt&lang:en*=readme.en.txt|text/plain\; charset=utf-8
/readme.txt=readme.zh.txt|text/plain\; charset=utf-8
/__readme.en.txt__=readme.en.txt|text/plain\; charset=utf-8
/readme.en.txt=readme.en.txt|text/plain\; charset=utf-8
/__readme.zh.txt__=readme.zh.txt|text/plain\; charset=utf-8
/readme.zh.txt=readme.zh.txt|text/plain\; charset=utf-8
/__changelog.txt__=changelog.txt|text/plain\; charset=utf-8
/changelog.txt=changelog.txt|text/plain\; charset=utf-8
/robots.txt=robots.txt|text/plain\; charset=utf-8
/knownissues.txt=knownissues.txt|text/plain\; charset=utf-8
/coming&host:hzj-jie.oicp.net&lang:en*=coming.en.html|text/html\; charset=utf-8
/coming&host:hzj-jie.oicp.net=coming.zh.html|text/html\; charset=utf-8
/coming.jpg&host:hzj-jie.oicp.net=coming.jpg|image/jpeg
/favicon.ico&host:unnamedhighland.gicp.net=wmgd.ico|image/x-icon
/favicon.ico&host:*wm8090.*=wmgd.ico|image/x-icon
debugmode$/__THIS_IS_A_TEST_REQUEST__=THIS_IS_A_NONEXISTING_FILE|text/plain\;;THIS_SHOULD_BE_COMMENT
/BingSiteAuth.xml=BingSiteAuth.xml
/googlea06cf6332d3f934f.html=googlea06cf6332d3f934f.html

